<h2>방제계획 및 실적 관리</h2>
<div class="content">
  <section class="accordion">
    <h3>검색조건</h3>
    <div>
      <form id="form1" name="form1" method="post" action="">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="searchTb">
          <tr>
            <th width="75" scope="row">지역</th>
            <td><select name="select" id="select">
                <option selected="selected">전체</option>
                <option>서울특별시</option>
                <option>경기도</option>
                <option>강원도</option>
              </select>
              <select name="select2" id="select2">
                <option>전체</option>
                <option>유성구</option>
                <option>서구</option>
                <option>동구</option>
              </select>
              <select name="select3" id="select3">
                <option>전체</option>
                <option>갈마동</option>
                <option>둔산동</option>
                <option>월평동</option>
              </select></td>
            <th width="75" scope="row">병해충명</th>
            <td><select name="select4" id="select4">
                <option selected="selected">전체</option>
                <option>서울특별시</option>
                <option>경기도</option>
                <option>강원도</option>
              </select></td>
          </tr>
          <tr>
            <th scope="row">사업명</th>
            <td><input name="textfield3" type="text" class="" id="textfield3" /></td>
            <th scope="row">사업지</th>
            <td><input name="textfield3" type="text" class="" id="textfield4" /></td>
          </tr>
          <tr>
            <th scope="row">진행상태</th>
            <td colspan="3">
                <label class="radio-inline">
                  <input type="radio" name="radio1" id="radio3" value="radio" />
                  기공</label>
                <label class="radio-inline">
                  <input type="radio" name="radio1" id="radio3" value="radio" />
                  착공</label>
                <label class="radio-inline">
                  <input type="radio" name="radio1" id="radio3" value="radio" />
                  완공</label>
                <label class="radio-inline">
                  <input type="radio" name="radio1" id="radio3" value="radio" />
                  준공</label>
              </td>
          </tr>
          <tr>
            <th rowspan="2" scope="row">기간설정</th>
            <td colspan="3">
                <label>
                <input type="radio" name="radio2" id="radio3" value="radio" />
                착수일자
                <label>
                <label>
                <input type="radio" name="radio2" id="radio4" value="radio" />
                준공일자
                <label for="radio4"></label>
              </td>
          </tr>
          <tr>
            <td colspan="3"><label for="textfield"></label>
              <input name="textfield" type="text" class="datepicker" id="textfield" />
              ~
              <input name="textfield2" type="text" class="datepicker" id="textfield2" /></td>
          </tr>
        </table>
        <div class="btn_dp">
          <button type="button">초기화</button>
          <button type="button" onClick="loadData()">조회</button>
        </div>
      </form>
    </div>
  </section>
  <section>
    <div>
      <div class="btn_dp"> <a href="/Templates/excelDownload.html" class="btn" target="_blank">엑셀 다운로드</a> <a href="/Templates/방제실적등록.html" class="btn new">등록</a> </div>
      <table id="jsonmap">
      </table>
      <div id="pjmap"> </div>
      <script type="text/javascript">
		jQuery("#jsonmap").jqGrid({        
			url:'/sample/data8.json',
			datatype: "json",
			colNames : [
			'진행상태'
			,'방제방법'
			,'지역'
			,'사업명'
			,'사업지'
			,'구역면적(ha)'
			,'제거대상(본)'
			,'실시설계액(천원)'
			,'설계자'
			,'계'
			,'도급액'
			,'관급자재'
			,'계'
			,'계약액'
			,'관급자재'
			,'시공사'
			,'착수일자'
			,'완공일자'
			],
			colModel:[
				 {name:'진행상태' ,	width:51, 	align:"center"}
				,{name:'방제방법' ,	width:60, 	align:"center"}
				,{name:'지역' ,	width:94, 	align:"center"}
				,{name:'사업명' ,	width:238, 	align:"left"}
				,{name:'사업지' ,	width:90, 	align:"left"}
				,{name:'구역면적(ha)' ,	width:78, 	align:"center"	,formatter:'number'	,align:'right'}
				,{name:'제거대상(본)' ,	width:81, 	align:"center" 	,formatter:'number'	,align:'right'}
				,{name:'실시설계액(천원)' ,	width:93, 	align:"center" 	,formatter:'number'	,align:'right'}
				,{name:'설계자' ,	width:116, 	align:"center" }
				,{name:'계1' ,	width:63, 	align:"center" 	,formatter:'number'	,align:'right'}
				,{name:'도급액' ,	width:59, 	align:"center" 	,formatter:'number'	,align:'right'}
				,{name:'관급자재' ,	width:63, 	align:"center" 	,formatter:'number'	,align:'right'}
				,{name:'계2' ,	width:67, 	align:"center" 	,formatter:'number'	,align:'right'}
				,{name:'계약액' ,	width:63, 	align:"center" 	,formatter:'number'	,align:'right'}
				,{name:'관급자재' ,	width:52, 	align:"center" 	,formatter:'number'	,align:'right'}
				,{name:'시공사' ,	width:100, 	align:"center"}
				,{name:'착수일자' ,	width:100, 	align:"center"}
				,{name:'완공일자' ,	width:100, 	align:"center"}

			]
			, rowNum:20
			, rowList:[10,20,30]
			, pager: '#pjmap'
			, viewrecords: true
			, height: 400
			, caption : '방제실적 목록'
			, autowidth : true
			, shrinkToFit : false
			, editurl : 'test.jsp'
			, multiselect : false
			, subGrid : true
			, subGridRowExpanded: function(subgrid_id, row_id) {
			
					var subgrid_table_id, pager_id;
					subgrid_table_id = subgrid_id+"_t";
					pager_id = "p_"+subgrid_table_id;
					$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
					$("#"+subgrid_table_id).jqGrid({        
						url:'/sample/data4.json',
						datatype: "json",
						colNames : ['발생조사관리번호'
									,'관리 기관구분'	
									,'발생X좌표'	
									,'발생Y좌표'	
									,'발생지'		
									,'지번'		
									,'기타'		
									,'경급'		
									,'감염목구분'	
									,'시료채취유무'	
									,'검경요청여부'	
									,'예찰자직급'	
									,'예찰자성명'	
									,'예찰일'		
									,'입력자'		
									,'입력일시'	
									],
						colModel:[
							 {name:'발생조사관리번호' ,	width:100, 	align:"center"}
							,{name:'관리 기관구분' ,	width:55, 	align:"center", editable:true}
							,{name:'발생X좌표' ,	width:70, 	align:"center" , editable:true}
							,{name:'발생Y좌표' ,	width:70, 	align:"center" , editable:true}
							,{name:'발생지' ,	width:200, 	align:"left" , editable:true}
							,{name:'지번' ,	width:30, 	align:"center" , editable:true}
							,{name:'기타' ,	width:30, 	align:"center" , editable:true}
							,{name:'경급' ,	width:100, 	align:"center"	, editable:true}
							,{name:'감염목구분' ,	width:100, 	align:"center"	, editable:true}
							,{name:'시료채취유무' ,	width:100, 	align:"center", editable:true}
							,{name:'검경요청여부' ,	width:100, 	align:"center", editable:true}
							,{name:'예찰자직급' ,	width:100, 	align:"center", editable:true}
							,{name:'예찰자성명' ,	width:100, 	align:"center", editable:true}
							,{name:'예찰일' ,	width:100, 	align:"center", editable:true}
							,{name:'입력자' ,	width:100, 	align:"center", editable:true}
							,{name:'입력일시' ,	width:100, 	align:"center", editable:true}
			
						]
						, rowNum:5
						, rowList:[10,20,30]
	//					, pager: '#pjmap'
//						, viewrecords: true
//						, height: '800'
						, autowidth : true
						, shrinkToFit : false
//						, editurl : 'test.jsp'
						
					});
			}
			, onSelectRow : function(rowid, status) {
				if ( status ) {
					var data = $(this).getRowData(rowid);
					$(this).newWin("방제실적상세.html", data['사업명']);
				}
			}
			
		});
		jQuery("#jsonmap").jqGrid('navGrid','#pjmap',{}
		, {height:280,reloadAfterSubmit:false} // edit options
		, {height:280,reloadAfterSubmit:false} // add options
		, {reloadAfterSubmit:false} // del options
		, {}
		);
		jQuery("#jsonmap").jqGrid("setFrozenColumns");
		jQuery("#jsonmap").gridResize();


		jQuery("#jsonmap").jqGrid('setGroupHeaders', {
		  useColSpanStyle: true, 
		  groupHeaders:[
			{startColumnName: '구역면적(ha)', numberOfColumns: 4, titleText: '설계부분'},
			{startColumnName: '계1', numberOfColumns: 6, titleText: '시공부문'},
		  ]	
		});
		</script> 
    </div>
  </section>
</div>
